﻿namespace IQIGame.Onigao.GamePlay
{
    /// <summary>
    /// 类名 : API - UIQuest 界面
    /// 作者 : Canyon / 龚阳辉
    /// 日期 : 2024-07-09 10:18
    /// 功能 : 
    /// </summary>
    public static class APIUIQuest
    {
        /// <summary>
        /// 获取页签文本内容
        /// </summary>
        /// <param name="tab"></param>
        /// <returns>页面名</returns>
        static public string GetTabName(int tab)
        {
            UIQuestTabType em = (UIQuestTabType)tab;
            switch (em)
            {
                case UIQuestTabType.All:
                    return "所有任务";
                case UIQuestTabType.Main:
                    return "主线任务";
                case UIQuestTabType.Branch:
                    return "支线任务";
                case UIQuestTabType.Achievement:
                    return "成就任务";
                case UIQuestTabType.Activity:
                    return "活动任务";
            }
            return "";
        }

        /// <summary>
        /// 界面可显示页签
        /// </summary>
        static readonly public int[] Tabs = {
            (int)UIQuestTabType.All,
            (int)UIQuestTabType.Main,
            (int)UIQuestTabType.Branch,
            (int)UIQuestTabType.Achievement,
            (int)UIQuestTabType.Activity,
        };

        /// <summary>
        /// 界面可显示页签对应的Type和SubType
        /// new int[] 里面(Type,SubType,Type,SubType) ,当 SubType == 0 时，取所有 Type类型的数据
        /// </summary>
        static readonly public int[][] TabTypes = {
            new int[]{ 1,0,2,0,3,0,4,0 },
            new int[]{ 1,0 },
            new int[]{ 2,0 },
            new int[]{ 3,0 },
            new int[]{ 4,0 },
        };

        /// <summary>
        /// 任务当前执行状态
        /// </summary>
        static public string GetQuestState(QuestState state)
        {
            return state switch
            {
                QuestState.Activating => "进行中",
                QuestState.CanCommit => "可提交",
                QuestState.Success => "已完成",
                QuestState.Fails => "已取消",
                _ => "",
            };
        }

        static public string GetQuestStateEng(QuestState state)
        {
            return state switch
            {
                QuestState.Activating => "In Progress",
                QuestState.CanCommit => "Can Commit",
                QuestState.Success => "Commited",
                QuestState.Fails => "Canceled",
                _ => "",
            };
        }

        static public string GetBtnByQuestState(QuestState state)
        {
            return state switch
            {
                QuestState.Activating => "前往",
                QuestState.CanCommit => "提交",
                _ => "",
            };
        }
    }
}
